Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the raising to high level operator within Unify Axis #565

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

nkoskelo
Copy link
Contributor

No description provided.

pytato/transform/metadata.py Outdated Show resolved Hide resolved
pytato/transform/metadata.py Outdated Show resolved Hide resolved
pytato/transform/metadata.py Outdated Show resolved Hide resolved
pytato/transform/metadata.py Outdated Show resolved Hide resolved
pytato/transform/metadata.py Outdated Show resolved Hide resolved
@inducer
Copy link
Owner

inducer commented Nov 25, 2024

Unsubscribing... @-mention or request review once it's ready for a look or needs attention.

@nkoskelo nkoskelo requested a review from inducer December 20, 2024 16:52
pytato/transform/metadata.py Outdated Show resolved Hide resolved
pytato/transform/metadata.py Outdated Show resolved Hide resolved
pytato/transform/metadata.py Outdated Show resolved Hide resolved
pytato/transform/metadata.py Outdated Show resolved Hide resolved
pytato/transform/metadata.py Outdated Show resolved Hide resolved
pytato/transform/metadata.py Outdated Show resolved Hide resolved
pytato/transform/metadata.py Outdated Show resolved Hide resolved
pytato/transform/metadata.py Outdated Show resolved Hide resolved
pytato/transform/metadata.py Outdated Show resolved Hide resolved
pytato/transform/metadata.py Outdated Show resolved Hide resolved
@nkoskelo nkoskelo requested a review from inducer January 16, 2025 01:44
pytato/transform/metadata.py Show resolved Hide resolved
as its aggregate.
"""

if isinstance(expr.aggregate, prim.Variable):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a recursion. Subscripts can contain subscripts.

pytato/transform/metadata.py Show resolved Hide resolved
@@ -156,7 +198,7 @@ def __init__(self, tag_t: type[Tag]) -> None:

# axis_to_var: mapping from (array, iaxis) to the variable to be
# used for unification.
self.axis_to_var: bidict[tuple[Array, int], str] = bidict()
self.axis_to_var: bidict[tuple[Array, int | str], str] = bidict()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like you're changing what identifies an axis here. Why? How? Will this still be unique? (The answers to these questions should become documentation.)

pytato/transform/metadata.py Show resolved Hide resolved
pytato/transform/metadata.py Show resolved Hide resolved
pytato/transform/metadata.py Show resolved Hide resolved
if isinstance(var_ind_name, prim.Variable):
lhs: str = self.get_var_for_axis(expr.bindings[vname],
axis_ind)
if IDX_LAMBDA_INAME.fullmatch(var_ind_name.name):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an else case here, to document that you've thought about it. E.g.

else:
    raise AssertionError()

for vname, set_of_ind_tuple in index_expr_used.items():
for ind_tuple in set_of_ind_tuple:
for axis_ind, var_ind_name in enumerate(ind_tuple):
if isinstance(var_ind_name, prim.Variable):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an else case here, to document that you've thought about it. E.g.

else:
    raise AssertionError()

pytato/transform/metadata.py Show resolved Hide resolved
@inducer
Copy link
Owner

inducer commented Jan 16, 2025

Unsubscribing... @-mention or request review once it's ready for a look or needs attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants